package cn.zn.modules.money.his.controller;

import cn.zn.framework.common.utils.Result;
import cn.zn.modules.money.his.entity.dto.MoneyInfoSumDTO;
import cn.zn.modules.money.his.entity.vo.MoneyInfoSumVO;
import cn.zn.modules.money.his.service.MoneyInfoSumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping("money/his/moneyinfosum")
public class MoneyInfoSumController {

    @Autowired
    private MoneyInfoSumService moneyInfoSumService;

    @RequestMapping("sumList")
    public Result<List<MoneyInfoSumVO>> sumList(@Valid @RequestBody MoneyInfoSumDTO moneyInfoSumDTO) {
        List<MoneyInfoSumVO> sum = moneyInfoSumService.findSum(moneyInfoSumDTO);
        return Result.ok(sum);
    }
}
